package com.yingxin.yxerp.module.report.entity.enums;

/**
 * 动态任务执行状态枚举
 */

public enum DynamicTaskLogStatusEnums {

    FAIL(-1, "失败"),

    EXECUTING(0, "执行中"),

    SUCCESS(1, "成功");

    private Integer status;

    private String statusName;

    DynamicTaskLogStatusEnums(Integer status, String statusName) {
        this.status = status;
        this.statusName = statusName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public static DynamicTaskLogStatusEnums getEnum(Integer status) {
        for (DynamicTaskLogStatusEnums i : DynamicTaskLogStatusEnums.values()) {
            if ( i.getStatus().equals( status ) ) {
                return i;
            }
        }
        return null;
    }

}
